package org.cytoscape.myapp.cytoscape_app_v1.internal.tasks.visualHideEdge;

import java.util.List;

import org.cytoscape.application.CyApplicationManager;
import org.cytoscape.model.CyEdge;
import org.cytoscape.model.CyNetwork;
import org.cytoscape.model.CyNode;
import org.cytoscape.view.model.CyNetworkView;
import org.cytoscape.view.presentation.property.BasicVisualLexicon;
import org.cytoscape.work.Task;
import org.cytoscape.work.TaskFactory;
import org.cytoscape.work.TaskIterator;
import org.cytoscape.work.TaskMonitor;

public class VirtualEdgeTaskFactory implements TaskFactory{
//private CyApplicationManager applicationManager;
private CyApplicationManager applicationManager;
private StateVisualEdge stateVisualEdge;

	public VirtualEdgeTaskFactory(CyApplicationManager applicationManager,StateVisualEdge state ){
		this.applicationManager= applicationManager;
		this.stateVisualEdge = state;
	}
	
	@Override
	public TaskIterator createTaskIterator() {
		TaskIterator taskIterator = new TaskIterator();
		Task deleteVirtualEdgetask = new DeleteVirtualEdgeTask(applicationManager,stateVisualEdge);
		Task createVirtualEdgeTask = new CreateVirtualEdgeTask(applicationManager,stateVisualEdge);
		Task hideVirtualEdgeTask = new HideVirtualEdgeTask(applicationManager,stateVisualEdge);
	//	taskIterator.append(deleteVirtualEdgetask);
		//taskIterator.insertTasksAfter(deleteVirtualEdgetask,createVirtualEdgeTask);
		taskIterator.append(createVirtualEdgeTask);
		taskIterator.insertTasksAfter(createVirtualEdgeTask, hideVirtualEdgeTask);
		
		return taskIterator;
	}

	@Override
	public boolean isReady() {
		// TODO Auto-generated method stub
		return false;
	}

	
	
}
